#pragma once
#include "..\Synchronization\ThreadPool.h"
#include "..\CoreInterfaces.h"
namespace re
{
	namespace core
	{
		typedef std::list<EventListenerPtr> EventListenerList;
		typedef std::map<EventType, EventListenerList> EventTypeMap;
		class EventManager : public IEventManager
		{
		public:
			EventManager() {}
			~EventManager() {}

			virtual void VTriggerEvent(EventDataPtr data);
			virtual void VQueueEvent(EventDataPtr data);

			virtual void VTick();

			virtual void VRegisterEvent(EventType type);

			virtual void VRegisterListener(EventListenerPtr listener);
			virtual void VRegisterListener(EventListenerPtr listener, EventType type);


			RealtimeQueue<EventDataPtr> queue_;
			EventListenerList global_listeners_;
			EventTypeMap event_types_; 

		};
	}
}